\documentclass{ctexart}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{pifont}
\title{第五次课堂作业}
\author{邵柯欣 \\学号：3200103310 \\课程名称：数据科学的数学基础}
\begin{document}
\maketitle
\section{}
Prove that for any positive definite matrix $M \in \mathbb{R}^{d \times d}$(not necessary symmetric), the following distance function
\begin{equation}
  d_{M}(a,b) = \sqrt{(a-b)^{\top} M (a-b)}, \forall a,b \in \mathbb{R}^d
\end{equation}
defines a metric in $\mathbb{R}^d$.\\
\textbf{Solution:}\\
\ding{172} $d(a,b) \ge 0$\\
显然成立。
\\
\ding{173} $d(a,b) = 0$ if and only if $a = b$\\
$d_{M}(a,b) = 0 \iff (a-b)^{\top} M (a-b) = 0 \iff |(a-b)^{\top} M (a-b)| = |(a-b)^{\top}||M||a-b| = 0$\\
Since $M$ is positive definite matrix, $|M| > 0$.\\
Thus $|a-b| = |(a-b)^{\top}| = 0$ i.e. $a = b$.\\
In conclusion, $d_{M}(a,b) = 0 \iff a = b$
\\
\ding{174} $d(a,b) = d(b,a)$\\
$(b-a)^{\top} ((a-b)^{\top})' = ((a-b)' (b-a))^{\top} = (a-b)' (b-a) = -I$\\
$(a-b)^{\top} M (a-b) = (b-a)^{\top} ((a-b)^{\top})' (a-b)^{\top} M (a-b) (a-b)' (b-a) = (b-a)^{\top} M (b-a)$.\\
$\sqrt{(a-b)^{\top} M (a-b)} = \sqrt{(b-a)^{\top} M (b-a)}$\\
Thus, $d_{M}(a,b) = d_{M}(b,a)$.\\ 
\\
\ding{175} $d(a,b) \le d(a,c) + d(c,b)$\\
Because $Mahalanobis$ $distance$ is metric,\\
$(a-b)^{\top} M (a-b) \le (a-c)^{\top} M (a-c) + (c-b)^{\top} M (c-b) \le (\sqrt{(a-c)^{\top} M (a-c)} + \sqrt{(c-b)^{\top} M (c-b)})^2$.\\
Thus $\sqrt{(a-b)^{\top} M (a-b)} \le \sqrt{(a-c)^{\top} M (a-c)} + \sqrt{(c-b)^{\top} M (c-b)}$ i.e. $d_{M}(a,b) \le d_{M}(a,c) + d_{M}(c,b)$.
\section{}
Show that any $\mathnormal{L}_p$ distance ($1 \le p \le \infty$) in $\mathnormal{R}^d$ are equivalent. Namely, for any $1 \le p_1, p_2 \le \infty$, there exist $\alpha_1 > 0$ and $\alpha_2 > 0$, such that
\begin{equation}
  \alpha_1\|a-b\|_{p_1} \le \|a-b\|_{p_2} \le \alpha_2\|a-b\|_{p_1}, \forall a,b \in \mathbb{R}^d,
\end{equation}
where $\alpha_1$ and $\alpha_2$ are independent of $a$ and $b$.\\
\textbf{Solution:}\\
For $p_1 \le p_2$ i.e. $\dfrac{p_2}{p_1} \ge 1$,\\
\begin{align}
  (\sum (a_i-b_i)^{p_1})^{\frac{p_2}{p_1}} &\ge \sum((a_i-b_i)^{p_1*\frac{p_2}{p_1}}) = \sum (a_i-b_i)^{p_2} \notag \\
  &\iff (\sum (a_i-b_i)^{p_2})^{\frac{1}{p_2}} \le (\sum (a_i-b_i)^{p_1})^{\frac{1}{p_1}} \notag \\
  &\iff \|a-b\|_{p_2} \le \|a-b\|_{p_1}. \notag
\end{align}
\begin{align}
  (\dfrac{\sum (a_i-b_i)^{p_1}}{n})^{\frac{p_2}{p_1}}& \le \dfrac{\sum ((a_i-b_i)^{p_1})^{\frac{p_2}{p_1}}}{n} = \dfrac{\sum (a_i-b_i)^{p_2}}{n} \notag \\
  &\iff \dfrac{(\sum (a_i-b_i)^{p_1})^{\frac{1}{p_1}}}{n^{\frac{1}{p_1}}} \le \dfrac{(\sum (a_i-b_i)^{p_2})^{\frac{1}{p_2}}}{n^{\frac{1}{p_2}}} \notag\\
  &\iff \|a-b\|_{p_1} \le n^{\frac{p_2-p_1}{p_2p_1}}\|a-b\|_{p_2}. \notag
\end{align}
Thus $\|a-b\|_{p_2} \le \|a-b\|_{p_1} \le n^{\frac{p_2-p_1}{p_2p_1}}\|a-b\|_{p_2}$.\\
For the same reason, $p_2 \le p_1$\\
$n^{\frac{p_2-p_1}{p_2p_1}}\|a-b\|_{p_2} \le \|a-b\|_{p_1} \le \|a-b\|_{p_2}$.
\end{document}
